<template>
  <div class="introduce-box">
    <!-- <div class="user-info">
      <div class="info-box" @click="login">{{ encryption }}</div>
      <HeadCom :isBnb="isBnb" :address="address" :info="info" />
    </div> -->

    <div class="introduce-title-box">
      <div class="introduce-body">
        <div style="margin-bottom: 32px;">
          <div class="introduce-title">
            <img src="@/static/icon/left-icon.png" alt="" srcset="">
            <span>UKEY NETWORK{{ t("introduction") }}</span>
            <img src="@/static/icon/right-icon.png" alt="" srcset="">
          </div>
          <p class="content-body">{{ t("introduce1") }}</p>
        </div>
        <div style="margin-bottom: 32px;">
          <div class="introduce-title">
            <img src="@/static/icon/left-icon.png" alt="" srcset="">
            <span>UKEY BOX{{ t("introduction") }}</span>
            <img src="@/static/icon/right-icon.png" alt="" srcset="">
          </div>
          <p class="content-body">{{ t("introduce2") }}</p>
        </div>
        <div style="margin-bottom: 32px;">
          <div class="introduce-title">
            <img src="@/static/icon/left-icon.png" alt="" srcset="">
            <span>UKEY Wallet{{ t("introduction") }}</span>
            <img src="@/static/icon/right-icon.png" alt="" srcset="">
          </div>
          <p class="content-body">{{ t("introduce3") }}</p>
        </div>
        <div>
          <div class="introduce-title">
            <img src="@/static/icon/left-icon.png" alt="" srcset="">
            <span>UKEY Swap{{ t("introduction") }}</span>
            <img src="@/static/icon/right-icon.png" alt="" srcset="">
          </div>
          <p class="content-body">{{ t("introduce4") }}</p>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
import { ref, onMounted, watch } from "vue";
// import HeadCom from "@/components/HeadCom.vue";
import { useI18n } from "vue-i18n";
const { t, locale } = useI18n();
const encryption = ref("");
const address = ref(""); // 钱包地址


// 监听语言切换
watch(locale, (nData) => {
  if (nData) {
    encryption.value = t("connectedWallet");
    if (!address.value) return;
    encryption.value = plusXing(address.value);
  }
});
onMounted(() => {
  encryption.value = t("connectedWallet");
});

// 格式化钱包地址
const plusXing = (str) => {
  let xing = "";
  for (let i = 0; i < 4; i++) {
    xing += "*";
  }
  return str.substring(0, 5) + xing + str.substring(str.length - 3);
};

</script>

<style lang="scss" scoped>
@import "../home/homeView.scss";
</style>
<style lang="scss" scoped>
.introduce-box {
  width: 100%;
  height: 100%;
  padding-bottom: 100px;
  background: url("@/static/bg.png") no-repeat;
  background-size: cover;

  .user-info {
    display: flex;
    justify-content: space-between;
    color: #fff;
    padding: 10px 12px;

    .info-box {
      padding: 5px 10px;
      border-radius: 20px;
      font-size: 13px;
      background-color: #1f1f1f;
    }
    .info-right {
      display: flex;
    }
  }

  .introduce-title-box {
    margin: 0 15px 0 15px;
    padding-top: 400px;
    color: #fff;

    .introduce-head {
      font-size: 18px;
      font-family: PingFangSC-Medium;
      font-weight: Medium;
      margin: 35px 0 25px 0;
    }

    .introduce-body {
      font-size: 14px;
      font-family: PingFangSC-Regular;
      font-weight: Regular;

      .content-body {
        border-radius: 5px;
        border: 1px solid #f0bc0f;
        padding: 15px 10px;
      }

      .introduce-title {
        font-size: 18px;
        font-weight: Medium;
        text-align: center;

        img {
          width: 58px;
          height: 12px;
        }

        span {
          margin: 0 6px;
        }
      }
    }
  }
}
</style>
